<template>
  <div id="order-item">
    <div class="order-header">
        <div class="head-left">
            <img :src="showImage">
            <span class="title">{{orderInfo.shop}}</span>
        </div>
        <span class="head-right">交易成功</span>
    </div>
    <div class="order-com">
        <div class="order-img">
            <img :src="orderInfo.img" alt="商品图片">
        </div>
        <div class="order-info">
            <div class="order-title">{{orderInfo.title}}</div>
            <div class="order-desc">商品描述: {{orderInfo.desc}}</div>
      
            <div class="order-bottom">
                <div class="order-price left">¥{{orderInfo.price}}</div>
                <div class="order-count right">x{{orderInfo.count}}</div>
            </div>
        </div>
    </div>
    
  </div>
</template>

<script>
export default {
    name: 'OrderListItem',
    props: {
    orderInfo: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  computed:{
    showImage(){
      return "http:" + this.orderInfo.logoImg;
    }
  },
}
</script>

<style scoped>
#order-item {
    /* width: 100%;
    display: flex;
    font-size: 0;
    padding: 5px;
    border-bottom: 1px solid #ccc; */
    margin: 5px auto 0;
    width: 95%;
    height: 165px;
    background-color: #fff;
    box-shadow: 1px 1px 3px #c5c5c5;
    border-radius: 8px;
  }
.order-header {
    width: 100%;
    height: 40px;
    overflow: hidden;
}
.head-left {
    float: left;
    
}
.head-left .title {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    top: -10px;
    line-height: 40px;
    font-weight:bolder;
}
.head-left img {
    width: 30px;
    height: 30px;
    margin-top: 10px;
    margin-left: 10px;
}
.head-right {
    float: right;
    line-height: 50px;
    margin-right: 14px;
    color: orange;
}
.order-com {
    margin-top: 5px;
}
.order-title, .order-desc {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .order-img {
    margin-top: 5px;
    margin-left: 5px;
    padding: 5px;
    float: left;
   }

  .order-img img {
    width: 80px;
    height: 100px;
    display: block;
    border-radius: 5px;
  }

  .order-info {
    /* float: right; */
    font-size: 17px;
    color: #333;
    padding: 10px 10px;
    position: relative;
    overflow: hidden;
  }

  .order-info .order-desc {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
  }

  .order-bottom {
    /* margin-top: 50px;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px; */
    margin-top: 30px;
  }

  .order-bottom .order-price {
    color: orangered;
  }
</style>